added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2010 / VBAzureBingMaps / WindowsPhoneClient / LocationConverter.vb
blob884a2e3627f99026292ec1faddcdd205dbb4975b
1 '***************************** Module Header ******************************\
2 '* Module Name: LocationConverter.vb
3 '* Project: AzureBingMaps
4 '* Copyright (c) Microsoft Corporation.
5 '*
6 '* A Silverlight converter.
7 '* Converts Travel data to Bing Maps Location.
8 '*
9 '* This source is subject to the Microsoft Public License.
10 '* See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
11 '* All other rights reserved.
12 '*
13 '* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
14 '* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
15 '* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
16 '\**************************************************************************
19 Imports System.Device.Location
20 Imports System.Windows.Data
21 Imports WindowsPhoneClient.AzureBingMaps.DAL
23 ''' <summary>
24 ''' A Silverlight converter.
25 ''' Converts Travel data to Bing Maps Location.
26 ''' </summary>
27 Public Class LocationConverter
28 Implements IValueConverter
29 Public Function Convert( _
30 ByVal value As Object, _
31 ByVal targetType As Type, _
32 ByVal parameter As Object, _
33 ByVal culture As System.Globalization.CultureInfo _
34 ) As Object Implements IValueConverter.Convert
35 If TypeOf value Is Travel Then
36 Dim t As Travel = DirectCast(value, Travel)
37 Return New GeoCoordinate(t.Latitude, t.Longitude)
38 End If
39 Return Nothing
40 End Function
42 Public Function ConvertBack( _
43 ByVal value As Object, _
44 ByVal targetType As Type, _
45 ByVal parameter As Object, _
46 ByVal culture As System.Globalization.CultureInfo _
47 ) As Object Implements IValueConverter.ConvertBack
48 Throw New NotImplementedException()
49 End Function
50 End Class